package main

import (
	"bww/cen"
	"flag"
	"net/http"
)

var url string

func init() {
	cen.BWWith("http2https v1.0_2022.11.3")
	flag.StringVar(&url, "h", "localhost", "Destination host name.")
	flag.Parse()
}

func jump(w http.ResponseWriter, r *http.Request) {
	http.Redirect(w, r, "https://" + url, http.StatusMovedPermanently)
}

func main() {
	http.HandleFunc("/", jump)
	http.ListenAndServe(":80", nil)
}